﻿using HDUSampling.HDUControls.HTools.LoadingFrm;
using HMI.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HMI.View
{
    /// <summary>
    /// OrderFrm.xaml 的交互逻辑
    /// </summary>
    public partial class OrderFrm : UserControl
    {
        public OrderFrm()
        {
            InitializeComponent();
            this.DataContext = new OrderFrmViewModel();
            ord.ViewTasksets = new Action<string, string> ((string id,string Batch) => {              
                ordlist.Visibility = Visibility.Visible;
                ord.Visibility = Visibility.Hidden;
                matlist.Visibility = Visibility.Hidden;
                ordlist.FillData(id, Batch);
            } );
            ordlist.BackEvent = new Action(() => {
                ord.Visibility = Visibility.Visible;
                ordlist.Visibility = Visibility.Hidden;
                matlist.Visibility = Visibility.Hidden;
            });

            ord.ViewMats = new Action<string>((string id) => {
                ordlist.Visibility = Visibility.Hidden;
                ord.Visibility = Visibility.Hidden;
                matlist.Visibility = Visibility.Visible;
                matlist.FillData(id);
            });
            matlist.BackEvent = new Action(() => {
                ord.Visibility = Visibility.Visible;
                ordlist.Visibility = Visibility.Hidden;
                matlist.Visibility = Visibility.Hidden;
            });
        }
    }
}
